/*
 * BlueTooth_Driver.h
 *
 *  Created on: Mar 5, 2024
 *      Author: DengZicheng
 */
/**
 * Copyright (c) 2024 Deng Zicheng
 *"BleSmartCar" is licensed under Mulan PSL v2.
 *You can use this software according to the terms and conditions of the Mulan PSL v2.
 *You may obtain a copy of Mulan PSL v2 at:
 *http://license.coscl.org.cn/MulanPSL2
 *THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 *See the Mulan PSL v2 for more details.
 */

#ifndef BLUETOOTH_DRIVER_H_
#define BLUETOOTH_DRIVER_H_


#include "main.h"

#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include "stdio.h"
#include "../../tools/strtool.h"
#include "../MPU6050/imu.h"
#include "../../SYS/Sys_process.h"

#define RX_MAX_VALUE 30

extern uint8_t message[RX_MAX_VALUE+1];

extern UART_HandleTypeDef huart1;
extern uint8_t NewData;
extern uint8_t  RX_Buffer[RX_MAX_VALUE];
extern uint32_t count;



void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart);
void messageProcess();
void messageProcessUser(uint8_t *header,uint8_t *body,uint32_t bodyLen);
void messageProcessAuto(uint8_t *header,uint8_t *body,uint32_t bodyLen);
void BT_print(char *fmt,...);

#endif /* BLUETOOTH_DRIVER_H_ */
